package org.tea.inventory.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * @author hanzy
 * @description 活动
 * @date 2023年04月06日 14:03
 */
public enum ActCouponEnum {
    FAILURE("0", "无效"),
    EFFECTIVE("1", "有效")
    ;

    @Getter
    @Setter
    private String code;
    @Getter
    @Setter
    private String content;

    ActCouponEnum(String code, String content) {
        this.code = code;
        this.content = content;
    }

    public static String getContentByName(String code) {
        for (ActCouponEnum useType : ActCouponEnum.values()) {
            if (useType.getCode().equals(code)) {
                return useType.getContent();
            }
        }
        return "";
    }
}
